import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
//封装的路由
import router from './config/router.js'
import httpAxios from './config/axios.js'
//element
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//封装的自定义公共方法
import Utils from './Utility/utils.js'
//暗黑样式
import 'element-plus/theme-chalk/dark/css-vars.css'
//国际化
import { createI18n } from 'vue-i18n'
import en from './config/Language/en.json'
import cn from './config/Language/zh-CN.json'
//vuex
import { createStore } from 'vuex'
//每个页面的store信息
import homePage from './config/vuex/homePage'
import homePanelPage from './config/vuex/homePanelPage'
import messageBoardPage from './config/vuex/messageBoardPage'
import loginPage from './config/vuex/loginPage'
//存储信息
const store = createStore({
    modules: {
        homeStore: homePage,
        homePanelStore: homePanelPage,
        messageBoardStore:messageBoardPage,
        loginPage:loginPage
    }
});

const i18n = createI18n({
    locale: 'cn', // 默认语言
    fallbackLocale: 'cn',
    messages: {
        en, // 英语
        cn // 中文
    },
});

var app = createApp(App)
// app.use(i18n)
app.use(store)
app.use(ElementPlus)
app.use(router)
app.use(Utils)
app.use(i18n)
app.provide('i18n', i18n)
app.provide('axios', httpAxios);
app.provide('utils', Utils)


app.mount('#app')

